home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / borland / jnfb88.zip / KEYINT.ZIP / MOREKEY.PAS < prev    next >
Pascal/Delphi Source File  |  1987-10-07  |  3KB  |  73 lines

  1. PROGRAM More_Keys;
  2. (* =============================================== *)
  3. (*  IN this example, the interrupt handler code    *)
  4. (*  is completely contained in the UNIT called     *)
  5. (*  "MOREKEYU".  The unit's initialization part    *)
  6. (*  installs the new interrupt, and its ExitProc   *)
  7. (*  restores the original interrupt.  This is      *)
  8. (*  totally invisible to your program -- just      *)
  9. (*  USE the unit and that's all!                   *)
  10. (* =============================================== *)
  11.  
  12. USES Crt,Dos,morekeyU;
  13.  
  14.   PROCEDURE Do_Demo;
  15.   VAR
  16.     CH, DH : Char;
  17.   BEGIN
  18.     ClrScr;
  19.     WriteLn('KEYBOARD INTERRUPT DEMO "More Keys"');
  20.     WriteLn('===================================');
  21.     WriteLn;
  22.     Write('Press various keys and combinations.  ');
  23.     WriteLn('The <Alt> plus keypad combinations');
  24.     Write('now work as in Appendix K of the TURBO ');
  25.     WriteLn('3.0 manual.  ALSO, the <Alt>+number');
  26.     Write('combinations are still available -- you ');
  27.     WriteLn('must press <Alt><LeftShift>+number.');
  28.     WriteLn('Hit <Esc> to end demo.');
  29.     WriteLn;
  30.     REPEAT
  31.       DH := #0;
  32.       CH := ReadKey;
  33.       IF (CH = #0) AND KeyPressed THEN
  34.         BEGIN
  35.           DH := ReadKey;
  36.           CASE DH OF
  37.             #174 : WriteLn('<Alt><Home>');
  38.             #175 : WriteLn('<Alt><Up>');
  39.             #176 : WriteLn('<Alt><PgUp>');
  40.             #177 : WriteLn('<Alt><GreyMinus>'); {*}
  41.             #178 : WriteLn('<Alt><Left>');
  42.             #179 : WriteLn('<Alt><Center>');    {*}
  43.             #180 : WriteLn('<Alt><Right>');
  44.             #181 : WriteLn('<Alt><GreyPlus>');  {*}
  45.             #182 : WriteLn('<Alt><End>');
  46.             #183 : WriteLn('<Alt><Down>');
  47.             #184 : WriteLn('<Alt><PgDn>');
  48.             #185 : WriteLn('<Alt><Ins>');
  49.             #186 : WriteLn('<Alt><Del>');
  50.             (* ================================== *)
  51.             (* NOTE: The three keys marked with a *)
  52.             (* {*} do NOT appear in the list in   *)
  53.             (* Appendix K.  However, the scan     *)
  54.             (* codes are logical in relation to   *)
  55.             (* those that do appear.              *)
  56.             (* ================================== *)
  57.           END;
  58.         END
  59.       ELSE
  60.         CASE CH OF
  61.           #8  : Write(#8,' ',#8);
  62.           #13 : WriteLn;
  63.           #27 : ; {our QUIT signal}
  64.           ELSE Write(CH);
  65.         END;
  66.     UNTIL (CH = #27) AND (DH = #0);
  67.     {i.e., until you press <Esc> }
  68.   END;
  69.  
  70. BEGIN
  71.   Do_Demo;                       {show yer stuff!}
  72. END.
  73.